from pynput.keyboard import Key, Controller
import time

# 准备演奏
# 控制键盘
keyboard = Controller()
# 切换到jQuery键盘钢琴网页
keyboard.press(Key.alt)
time.sleep(1)
keyboard.press(Key.tab)
keyboard.release(Key.tab)
keyboard.release(Key.alt)
time.sleep(2)
#
# ,  ,  LMNONOMNLKL JJJKLJEE IIIJKIEE HHHIJIGH GFGHG FEFML IKJIH HGFIIHFFGH
for n in "LJ LI jIH   HGFGHG HIJ   LJ LP ONO   HGFGHgHIh   LMNO NONMLML   HIJK JKLHIj   LMNO NONPOqL   HIJK JKJiHGH     LMNO NOPONML   HIJK JKLHHML   LMNO  NONPOqL   HIJK  JKJih g h":
    if n != " ":
        if n.islower():
            keyboard.press(n)
            time.sleep(0.8)
            keyboard.release(n)
        else:
            keyboard.press(n.lower())
            time.sleep(0.5)
            keyboard.release(n.lower())
    elif n == '-':
        time.sleep(0.15)
    else:
        time.sleep(0.3)
